package com.inspire.myapp;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import com.codename1.io.Externalizable;

public class box implements Externalizable{
	public String id=null;
	public String nom =null;
	public String ip=null;
	public String model=null;
	public String uuid=null;
	
	public box() {
		
	}

	@Override
	public int getVersion() {
		return 0;
	}

	@Override
	public void externalize(DataOutputStream out) throws IOException {
		
		out.writeUTF(this.id);
		
		out.writeUTF(this.nom);
		
		out.writeUTF(this.ip);
		
		out.writeUTF(this.model);
		
		out.writeUTF(this.uuid);
		
	}

	@Override
	public void internalize(int version, DataInputStream in) throws IOException {
		switch (version) {
		case 0:
			this.id=in.readUTF();
			this.nom=in.readUTF();
			this.ip=in.readUTF();
			this.model=in.readUTF();
			this.uuid=in.readUTF();
			
			break;
		default:
			break;
		}
		
	}

	@Override
	public String getObjectId() {
		return "box_"+this.uuid;
	}

}

